Public Class FormLeaveTime


    Dim myLeavTime As DataTable
    Private Sub initalizeData()
        Try
            loadData()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
    Public Sub loadData()
        'Get Data From Database
        Try
            myLeavTime = LeaveTimes.GetLeavTime
            dgvLeaveTime.DataSource = myLeavTime
        Catch ex As Exception

        End Try
    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Dbinterface.OpenConnection()
        initalizeData()
    End Sub


 
    Private Sub FormLeaveTime_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        UI.FormatDataGrid(dgvLeaveTime)
        btnAdd.Enabled = App.IsAuthorized(Permissions.Manage_LeaveTime_Add)
        btnUpdate.Enabled = App.IsAuthorized(Permissions.Manage_LeaveTime_Edit)
        btnDelete.Enabled = App.IsAuthorized(Permissions.Manage_LeaveTime_Delete)
    End Sub
End Class